package com.cy.sentinel.controller;

import org.springframework.web.bind.annotation.*;

@RestController
@RequestMapping("/sentinel")

public class IndexController {

    /**
     * sentinel 簡單配置 demo application+pom依賴
     *
     * @return
     */
    //限流
    @GetMapping("/testA")
    public String testA() {
        return "testA";
    }

    //热点
//    @SentinelResource(value = "sendTestB",blockHandler = "gettestB")
    @PostMapping(value = "testB")
    public String testB(@RequestParam String mobile) {
        System.out.println("get testB success");
        return "OK";
    }

    public String gettestB(@RequestParam String mobile) {
        System.out.println("get testB err");
        return "testB 失败";
    }


}

